// calculator using switch case

# include <iostream.h>
# include <conio.h>

class SimpCalc {
  int a,b;
public:
  void get();
  void add();
  void sub();
  void mul();
  void div();
};

void SimpCalc::get() {
  cout << "Enter the numbers: " << endl;
  cin >> a >> b;
}

void SimpCalc::add() {
  cout << a + b;
}

void SimpCalc::sub() {
  cout << a - b;
}

void SimpCalc::mul() {
  cout << a * b;
}

void SimpCalc::div() {
  cout << a/b;
}

void main() {
  clrscr();
  int choice;
  SimpCalc sc;
  sc.get();
  cout <<  "\n***Menu***\n";
  cout << " 1. Add\n 2. Subtract \n 3. Multiply\n 4. Divide\n";
  cout << "Enter choice: ";
  cin >> choice;
  switch (choice) {
    case 1:
      sc.add();
      break;
    case 2:
      sc.sub();
      break;
    case 3:
      sc.mul();
      break;
    case 4:
      sc.div();
      break;
    default:
      cout << "Invalid Option!";
      break;
  }
  getch();
}